USE [DTP]
GO

/****** Object:  StoredProcedure [dbo].[GetAccidentData]    Script Date: 11/26/2010 11:00:43 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE PROCEDURE [dbo].[GetBackImage]
	@id bigint
AS
	SELECT
	t2.image
		
	FROM dbo.t_AccidentCards t1		
	LEFT JOIN dbo.t_Images t2 ON (t1.backPage = t2.Id)	
	WHERE t1.Deleted = 0 AND t1.id = @id


GO